<template>
	<view style="height: 100vh; background-color: #FFFFFF;">
		<u-navbar title-color="#FFFFFF" height="48" back-icon-color="#FFFFFF" :border-bottom="false" :is-fixed="true" title="通知详情"></u-navbar>
		<uc-content :loading="loading">
			<view class="list-item">
				<view class="list-bottom">
					<view>通知名称:</view>
					<view>{{noticeInfo.noticeName}}</view>
				</view>
			</view>
			<view class="list-item">
				<view class="list-bottom">
					<view>反馈状态:</view>
					<view>{{noticeInfo.feedbackStatus | noticeFeedback}}</view>
				</view>
			</view>
			<view class="list-item">
				<view class="list-bottom">
					<view>通知内容:</view>
					<view></view>
				</view>
				<view class="list-center">
					{{noticeInfo.noticeContent}}
				</view>
			</view>
			<view class="list-item">
				<view class="list-bottom">
					<view>发布时间:</view>
					<view>{{noticeInfo.addTime|dateFormat}}</view>
				</view>
			</view>
			<view class="list-item">
				<view class="list-bottom">
					<view>读取时间:</view>
					<view>{{noticeInfo.readTime|dateFormat}}</view>
				</view>
			</view>
			<view class="list-item">
				<u-button v-if="noticeInfo.feedbackStatus==0" @click="tofeedBack" type="primary" shape="square">反馈</u-button>
			</view>
		</uc-content>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				noticeInfo: {},
                taskId:"",
				loading:false
			}
		},
		onLoad(e) {
			this.taskId = e.ucId
		},
		onShow(){
			this.initView(this.taskId)
		},
		methods: {
			initView(val) {
				this.loading = true
				this.noticeInfo = {}
				this.pageNum = 0
				this.getNoticeInfo(val)
			},
			tofeedBack(){
				uni.navigateTo({
					url:"/pages/index/notice/feedback?ucId="+this.noticeInfo.ucId
				})
			},
			getNoticeInfo(val) {
				this.utils.request("/api/app/notice/getInNoticeVo", {	ucId: val}, "post", "app", true).then(res => {
					this.loading = false
					this.noticeInfo = res.data
				}).catch(error => {
					this.loading = false
					console.log(error)
				})
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	@import "../../../uview-ui/libs/css/style.components.scss";
	
	.list-item {
		padding: 20rpx 40rpx;
		background-color: #fff;
		border-bottom: #999999 1px dashed ;
	
		.list-bottom {
			display: flex;
			margin-top: 10rpx;
			font-size: 28rpx;
			justify-content: space-between;
			color: #333;
		}
		.list-center {
			margin-top: 20rpx;
			font-size: 28rpx;
			color: #999999;
		}
	}
	.feedBackButton{
		margin-top: 20rpx;
	}
</style>
